﻿using System;
using StockModel;
using Utils;

namespace Plugins.Base.Common
{
	[Serializable]
	public class DecisionEngineDataBase : PropertyChangedNotifierCopyable<DecisionEngineDataBase>
	{
		#region Attributes

		private DecisionEngineStateBase _state;
		private DecisionEngineStateBase _previousState;
		private Quotation _lastQuotation;
		private Quotation _previousQuotation;

		#endregion

		#region Properties

		public DecisionEngineStateBase State
		{
			get
			{
				return _state;
			}
			set
			{
				if (_state != value)
				{
					_state = value;
					base.OnPropertyChanged("State");
				}
			}
		}

		public DecisionEngineStateBase PreviousState
		{
			get
			{
				return _previousState;
			}
			set
			{
				if (_previousState != value)
				{
					_previousState = value;
					base.OnPropertyChanged("PreviousState");
				}
			}
		}


		public Quotation LastQuotation
		{
			get
			{
				return _lastQuotation;
			}
			set
			{
				if (_lastQuotation != value)
				{
					_lastQuotation = value;
					base.OnPropertyChanged("LastQuotation");
				}
			}
		}

		public Quotation PreviousQuotation
		{
			get
			{
				return _previousQuotation;
			}
			set
			{
				if (_previousQuotation != value)
				{
					_previousQuotation = value;
					base.OnPropertyChanged("PreviousQuotation");
				}
			}
		}

		#endregion

		#region Public Methods

		public DecisionEngineDataBase()
		{
			this.State = DecisionEngineStateBase.WaitingOpen;
			this.PreviousState = DecisionEngineStateBase.None;
		}

		#endregion
	}
}
